<template>
	<text class="flex align-center justify-center cartf iconfont icon-kefu3" :style="{ top: top + 'px'}" @click.stop="goCustomer"
		@touchmove.stop.prevent="setTouchMove" style="z-index: 999;" v-if="isShow">
		<!-- <text class="cuIcon-servicefill text-theme"></text> -->
		<image src="../../../../static/top.png" mode="" style="width: 130rpx;height: 130rpx;"></image>
	</text>
	
</template>

<script>
	let app = getApp();
	export default {
		name: "kefuIcon",
		props: {
			ids: {
				type: Number,
				default: 0
			},
			routineContact: {
				type: Number,
				default: 0
			},
			goodsCon: {
				type: Number,
				default: 0
			},
			isShow:{
			  type:Boolean,
			  default:false
			}
		},
		data: function() {
			return {
				top: "900",
			};
		},
		mounted() {
			// #ifdef H5
			this.top = parseFloat(window.innerHeight) - 200
			// #endif
			
		},
		methods: {
			handleScroll() {
			  // 获取页面滚动的距离
			  const scrollTop = uni.getSystemInfoSync().scrollTop;
		
			  // 设置按钮显示条件，比如滚动超过 200px 显示按钮
			  this.showButton = scrollTop > 200;
			},
			goCustomer() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300, // 滚动到顶部的时间，单位为毫秒
				  });
				setTimeout(()=>{
					this.isShow = false
				},300)
			},
			setTouchMove(e) {
				let that = this;
				if (e.touches[0].clientY < 480 && e.touches[0].clientY > 66) {
					that.top = e.touches[0].clientY
				}
			}
		},
		created() {}
	};
</script>

<style lang="scss">
	.cartf {
		width: 96rpx;
		height: 96rpx;
		// background: rgba(255, 255, 255, 0.8);
		// box-shadow: 0 3rpx 16rpx rgba(0, 0, 0, 0.08);
		backdrop-filter: blur(10px);
		border-radius: 50%;
		font-size: 47rpx;
		color: #666;
		position: fixed;
		right: 24rpx;
		z-index: 9;
	}
</style>
